package com.fz.us.admin.company.dao;

import com.fz.us.admin.base.dao.BaseDao;
import com.fz.us.admin.company.entity.Company;
import com.fz.us.admin.company.entity.Department;

import java.util.List;

/**
 * Dao接口 - 部门
 * ============================================================================
 * 版权所有 2016 。
 *
 * @author fallenpanda
 * @version 1.0 2016-07-27 。
 * ============================================================================
 */
public interface DepartmentDao extends BaseDao<Department,String> {

    /**
     * 获取公司下的所有部门列表
     *
     * @param company 企业
     * @return
     */
    public List<Department> getAllDepartments(Company company);

    /**
     * 获取公司下的顶级部门列表
     *
     * @param company 企业
     * @return
     */
    public List<Department> getRootDepartments(Company company);

    /**
     * 获取部门下的部门列表
     *
     * @param company 企业
     * @param department 部门
     * @return
     */
    public List<Department> getDepartments(Company company, Department department);

    /**
     * 是否有下级部门
     *
     * @param department
     * @return
     */
    public boolean isParentDepartment(Department department);

    public List<Department> getDepartments(String name);

}
